package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.entities.Dept;
import com.atguigu.springcloud.mapper.DeptMapper;
import com.atguigu.springcloud.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author horay
 * @category Class description
 * @email horay_hyc@qq.com
 * @date 2018/6/9 9:33
 */
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;

    @Override
    public Integer add(Dept dept) {
        return deptMapper.insert(dept);
    }

    @Override
    public Integer edit(Dept dept) {
        return deptMapper.update(dept);
    }

    @Override
    public Integer delete(Long deptNo) {
        return deptMapper.delete(deptNo);
    }

    @Override
    public Dept getByDeptNo(Long deptNo) {
        return deptMapper.getByDeptNo(deptNo);
    }

    @Override
    public List<Dept> findAll() {
        return deptMapper.findAll();
    }
}
